<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta m_name="generator" content="Doxygen 1.8.14"/>
<meta m_name="viewport" content="width=device-width, initial-scale=1"/>
<title>cpp_redis: cpp_redis::subscriber Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="cpp_redis_logo.jpg"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">cpp_redis
   &#160;<span id="projectnumber">4.0.0</span>
   </div>
   <div id="projectbrief">cpp_redis is a C++11 Asynchronous Multi-Platform Lightweight Redis Client, with support for synchronous operations and pipelining.</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.14 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        m_name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><b>cpp_redis</b></li><li class="navelem"><a class="el" href="classcpp__redis_1_1subscriber.html">subscriber</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#nested-classes">Classes</a> &#124;
<a href="#pub-types">Public Types</a> &#124;
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="classcpp__redis_1_1subscriber-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">cpp_redis::subscriber Class Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p><code>#include &lt;<a class="el" href="subscriber_8hpp_source.html">subscriber.hpp</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a m_name="pub-types"></a>
Public Types</h2></td></tr>
<tr class="memitem:afc976757efd9d0ac4def6935546a2338"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcpp__redis_1_1subscriber.html#afc976757efd9d0ac4def6935546a2338">connect_state</a> { <br />
&#160;&#160;<b>dropped</b>, 
<b>start</b>, 
<b>sleeping</b>, 
<b>ok</b>, 
<br />
&#160;&#160;<b>failed</b>, 
<b>lookup_failed</b>, 
<b>stopped</b>
<br />
 }</td></tr>
<tr class="separator:afc976757efd9d0ac4def6935546a2338"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7f9e56873e5b96ad9cb2395dadae1a7a"><td class="memItemLeft" align="right" valign="top"><a id="a7f9e56873e5b96ad9cb2395dadae1a7a"></a>
typedef std::function&lt; void(const std::string &amp;host, std::size_t port, <a class="el" href="classcpp__redis_1_1subscriber.html#afc976757efd9d0ac4def6935546a2338">connect_state</a> status)&gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcpp__redis_1_1subscriber.html#a7f9e56873e5b96ad9cb2395dadae1a7a">connect_callback_t</a></td></tr>
<tr class="memdesc:a7f9e56873e5b96ad9cb2395dadae1a7a"><td class="mdescLeft">&#160;</td><td class="mdescRight">connect handler, called whenever a new connection even occurred <br /></td></tr>
<tr class="separator:a7f9e56873e5b96ad9cb2395dadae1a7a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5533ac876d3116911b54ff0dce28f61c"><td class="memItemLeft" align="right" valign="top"><a id="a5533ac876d3116911b54ff0dce28f61c"></a>
typedef std::function&lt; void(<a class="el" href="classcpp__redis_1_1reply.html">reply</a> &amp;)&gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcpp__redis_1_1subscriber.html#a5533ac876d3116911b54ff0dce28f61c">reply_callback_t</a></td></tr>
<tr class="memdesc:a5533ac876d3116911b54ff0dce28f61c"><td class="mdescLeft">&#160;</td><td class="mdescRight">reply callback called whenever a reply is received, takes as parameter the received reply <br /></td></tr>
<tr class="separator:a5533ac876d3116911b54ff0dce28f61c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2ac29261280f488dab483866ae875656"><td class="memItemLeft" align="right" valign="top">typedef std::function&lt; void(const std::string &amp;, const std::string &amp;)&gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcpp__redis_1_1subscriber.html#a2ac29261280f488dab483866ae875656">read_callback_t</a></td></tr>
<tr class="separator:a2ac29261280f488dab483866ae875656"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a19ea39dfabeb19937a9ce4c8d21781b4"><td class="memItemLeft" align="right" valign="top">typedef std::function&lt; void(int64_t)&gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcpp__redis_1_1subscriber.html#a19ea39dfabeb19937a9ce4c8d21781b4">acknowledgement_callback_t</a></td></tr>
<tr class="separator:a19ea39dfabeb19937a9ce4c8d21781b4"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a m_name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a7a6cf12c6f12fbc54cd80ceaf7ac4cba"><td class="memItemLeft" align="right" valign="top"><a id="a7a6cf12c6f12fbc54cd80ceaf7ac4cba"></a>
&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcpp__redis_1_1subscriber.html#a7a6cf12c6f12fbc54cd80ceaf7ac4cba">subscriber</a> ()</td></tr>
<tr class="memdesc:a7a6cf12c6f12fbc54cd80ceaf7ac4cba"><td class="mdescLeft">&#160;</td><td class="mdescRight">ctor <br /></td></tr>
<tr class="separator:a7a6cf12c6f12fbc54cd80ceaf7ac4cba"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a66136601f44564842e2c67de2da199af"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcpp__redis_1_1subscriber.html#a66136601f44564842e2c67de2da199af">subscriber</a> (const std::shared_ptr&lt; <a class="el" href="classcpp__redis_1_1network_1_1tcp__client__iface.html">network::tcp_client_iface</a> &gt; &amp;tcp_client)</td></tr>
<tr class="separator:a66136601f44564842e2c67de2da199af"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a24e54cbec0cc6dcae663cf9399740fe7"><td class="memItemLeft" align="right" valign="top"><a id="a24e54cbec0cc6dcae663cf9399740fe7"></a>
&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcpp__redis_1_1subscriber.html#a24e54cbec0cc6dcae663cf9399740fe7">~subscriber</a> ()</td></tr>
<tr class="memdesc:a24e54cbec0cc6dcae663cf9399740fe7"><td class="mdescLeft">&#160;</td><td class="mdescRight">dtor <br /></td></tr>
<tr class="separator:a24e54cbec0cc6dcae663cf9399740fe7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af5f11532bf727eeb2d4a926bdc775cd7"><td class="memItemLeft" align="right" valign="top"><a id="af5f11532bf727eeb2d4a926bdc775cd7"></a>
&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcpp__redis_1_1subscriber.html#af5f11532bf727eeb2d4a926bdc775cd7">subscriber</a> (const <a class="el" href="classcpp__redis_1_1subscriber.html">subscriber</a> &amp;)=delete</td></tr>
<tr class="memdesc:af5f11532bf727eeb2d4a926bdc775cd7"><td class="mdescLeft">&#160;</td><td class="mdescRight">copy ctor <br /></td></tr>
<tr class="separator:af5f11532bf727eeb2d4a926bdc775cd7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac60f83e6e915073bda6853baaeb39485"><td class="memItemLeft" align="right" valign="top"><a id="ac60f83e6e915073bda6853baaeb39485"></a>
<a class="el" href="classcpp__redis_1_1subscriber.html">subscriber</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcpp__redis_1_1subscriber.html#ac60f83e6e915073bda6853baaeb39485">operator=</a> (const <a class="el" href="classcpp__redis_1_1subscriber.html">subscriber</a> &amp;)=delete</td></tr>
<tr class="memdesc:ac60f83e6e915073bda6853baaeb39485"><td class="mdescLeft">&#160;</td><td class="mdescRight">assignment operator <br /></td></tr>
<tr class="separator:ac60f83e6e915073bda6853baaeb39485"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6ae8134a9a9b31d6f2434ec4f6e86d3a"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcpp__redis_1_1subscriber.html#a6ae8134a9a9b31d6f2434ec4f6e86d3a">connect</a> (const std::string &amp;host=&quot;127.0.0.1&quot;, std::size_t port=6379, const <a class="el" href="classcpp__redis_1_1subscriber.html#a7f9e56873e5b96ad9cb2395dadae1a7a">connect_callback_t</a> &amp;connect_callback=nullptr, std::uint32_t timeout_ms=0, std::int32_t max_reconnects=0, std::uint32_t reconnect_interval_ms=0)</td></tr>
<tr class="memdesc:a6ae8134a9a9b31d6f2434ec4f6e86d3a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Connect to redis server.  <a href="#a6ae8134a9a9b31d6f2434ec4f6e86d3a">More...</a><br /></td></tr>
<tr class="separator:a6ae8134a9a9b31d6f2434ec4f6e86d3a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8fb77a44a1e1f0d99dec639658e2aa7e"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcpp__redis_1_1subscriber.html#a8fb77a44a1e1f0d99dec639658e2aa7e">connect</a> (const std::string &amp;m_name, const <a class="el" href="classcpp__redis_1_1subscriber.html#a7f9e56873e5b96ad9cb2395dadae1a7a">connect_callback_t</a> &amp;connect_callback=nullptr, std::uint32_t timeout_ms=0, std::int32_t max_reconnects=0, std::uint32_t reconnect_interval_ms=0)</td></tr>
<tr class="memdesc:a8fb77a44a1e1f0d99dec639658e2aa7e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Connect to redis server.  <a href="#a8fb77a44a1e1f0d99dec639658e2aa7e">More...</a><br /></td></tr>
<tr class="separator:a8fb77a44a1e1f0d99dec639658e2aa7e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af73acfc3c1859e6b32bc9a69856e6e59"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcpp__redis_1_1subscriber.html#af73acfc3c1859e6b32bc9a69856e6e59">is_connected</a> () const</td></tr>
<tr class="memdesc:af73acfc3c1859e6b32bc9a69856e6e59"><td class="mdescLeft">&#160;</td><td class="mdescRight">determines client connectivity  <a href="#af73acfc3c1859e6b32bc9a69856e6e59">More...</a><br /></td></tr>
<tr class="separator:af73acfc3c1859e6b32bc9a69856e6e59"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aad1d0c3c6edb1522eb7b1bdb64b4705d"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcpp__redis_1_1subscriber.html#aad1d0c3c6edb1522eb7b1bdb64b4705d">disconnect</a> (bool wait_for_removal=false)</td></tr>
<tr class="memdesc:aad1d0c3c6edb1522eb7b1bdb64b4705d"><td class="mdescLeft">&#160;</td><td class="mdescRight">disconnect from redis server  <a href="#aad1d0c3c6edb1522eb7b1bdb64b4705d">More...</a><br /></td></tr>
<tr class="separator:aad1d0c3c6edb1522eb7b1bdb64b4705d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8df4503f738566d2acab5f080cd44b53"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcpp__redis_1_1subscriber.html#a8df4503f738566d2acab5f080cd44b53">is_reconnecting</a> () const</td></tr>
<tr class="memdesc:a8df4503f738566d2acab5f080cd44b53"><td class="mdescLeft">&#160;</td><td class="mdescRight">determines if reconnect is in progress  <a href="#a8df4503f738566d2acab5f080cd44b53">More...</a><br /></td></tr>
<tr class="separator:a8df4503f738566d2acab5f080cd44b53"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae93de179d6ea83ece59cf1a30493c3e9"><td class="memItemLeft" align="right" valign="top"><a id="ae93de179d6ea83ece59cf1a30493c3e9"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcpp__redis_1_1subscriber.html#ae93de179d6ea83ece59cf1a30493c3e9">cancel_reconnect</a> ()</td></tr>
<tr class="memdesc:ae93de179d6ea83ece59cf1a30493c3e9"><td class="mdescLeft">&#160;</td><td class="mdescRight">stop any reconnect in progress <br /></td></tr>
<tr class="separator:ae93de179d6ea83ece59cf1a30493c3e9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7b4564fc4dfe356b95aeae4fdb8071c9"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classcpp__redis_1_1subscriber.html">subscriber</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcpp__redis_1_1subscriber.html#a7b4564fc4dfe356b95aeae4fdb8071c9">auth</a> (const std::string &amp;password, const <a class="el" href="classcpp__redis_1_1subscriber.html#a5533ac876d3116911b54ff0dce28f61c">reply_callback_t</a> &amp;reply_callback=nullptr)</td></tr>
<tr class="memdesc:a7b4564fc4dfe356b95aeae4fdb8071c9"><td class="mdescLeft">&#160;</td><td class="mdescRight">ability to authenticate on the redis server if necessary this method should not be called repeatedly as the storage of reply_callback is NOT thread safe (only one reply callback is stored for the subscriber client) calling repeatedly <a class="el" href="classcpp__redis_1_1subscriber.html#a7b4564fc4dfe356b95aeae4fdb8071c9" title="ability to authenticate on the redis server if necessary this method should not be called repeatedly ...">auth()</a> is undefined concerning the execution of the associated callbacks  <a href="#a7b4564fc4dfe356b95aeae4fdb8071c9">More...</a><br /></td></tr>
<tr class="separator:a7b4564fc4dfe356b95aeae4fdb8071c9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:afee579c702182041645a3d3c55de4b9e"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classcpp__redis_1_1subscriber.html">subscriber</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcpp__redis_1_1subscriber.html#afee579c702182041645a3d3c55de4b9e">subscribe</a> (const std::string &amp;channel, const <a class="el" href="classcpp__redis_1_1subscriber.html#a2ac29261280f488dab483866ae875656">read_callback_t</a> &amp;callback, const <a class="el" href="classcpp__redis_1_1subscriber.html#a19ea39dfabeb19937a9ce4c8d21781b4">acknowledgement_callback_t</a> &amp;acknowledgement_callback=nullptr)</td></tr>
<tr class="separator:afee579c702182041645a3d3c55de4b9e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a52605edb2a85d370680c3c9e1b84fc3b"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classcpp__redis_1_1subscriber.html">subscriber</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcpp__redis_1_1subscriber.html#a52605edb2a85d370680c3c9e1b84fc3b">psubscribe</a> (const std::string &amp;pattern, const <a class="el" href="classcpp__redis_1_1subscriber.html#a2ac29261280f488dab483866ae875656">read_callback_t</a> &amp;callback, const <a class="el" href="classcpp__redis_1_1subscriber.html#a19ea39dfabeb19937a9ce4c8d21781b4">acknowledgement_callback_t</a> &amp;acknowledgement_callback=nullptr)</td></tr>
<tr class="separator:a52605edb2a85d370680c3c9e1b84fc3b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a08dffea41cfd5914adfa5a966e0ab292"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classcpp__redis_1_1subscriber.html">subscriber</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcpp__redis_1_1subscriber.html#a08dffea41cfd5914adfa5a966e0ab292">unsubscribe</a> (const std::string &amp;channel)</td></tr>
<tr class="separator:a08dffea41cfd5914adfa5a966e0ab292"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a26edc7dcf87ddc8734fac04878ca307a"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classcpp__redis_1_1subscriber.html">subscriber</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcpp__redis_1_1subscriber.html#a26edc7dcf87ddc8734fac04878ca307a">punsubscribe</a> (const std::string &amp;pattern)</td></tr>
<tr class="separator:a26edc7dcf87ddc8734fac04878ca307a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af78a5542315daac42998809eeec30eef"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classcpp__redis_1_1subscriber.html">subscriber</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcpp__redis_1_1subscriber.html#af78a5542315daac42998809eeec30eef">commit</a> ()</td></tr>
<tr class="separator:af78a5542315daac42998809eeec30eef"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2faf9e9cc9c95e3c0fed148355af84f1"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcpp__redis_1_1subscriber.html#a2faf9e9cc9c95e3c0fed148355af84f1">add_sentinel</a> (const std::string &amp;host, std::size_t port, std::uint32_t timeout_ms=0)</td></tr>
<tr class="separator:a2faf9e9cc9c95e3c0fed148355af84f1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0a6212dfba0513508fdc6377f83a0048"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="classcpp__redis_1_1sentinel.html">sentinel</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcpp__redis_1_1subscriber.html#a0a6212dfba0513508fdc6377f83a0048">get_sentinel</a> () const</td></tr>
<tr class="separator:a0a6212dfba0513508fdc6377f83a0048"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4a77354e12a6ef19cad7b0f55b62033c"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classcpp__redis_1_1sentinel.html">sentinel</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcpp__redis_1_1subscriber.html#a4a77354e12a6ef19cad7b0f55b62033c">get_sentinel</a> ()</td></tr>
<tr class="separator:a4a77354e12a6ef19cad7b0f55b62033c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3f8119bc43a67f8e22369aad529444ba"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcpp__redis_1_1subscriber.html#a3f8119bc43a67f8e22369aad529444ba">clear_sentinels</a> ()</td></tr>
<tr class="separator:a3f8119bc43a67f8e22369aad529444ba"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a m_name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>The <a class="el" href="classcpp__redis_1_1subscriber.html">cpp_redis::subscriber</a> is meant to be used for PUB/SUB communication with the Redis server. Please do not use <a class="el" href="classcpp__redis_1_1client.html">cpp_redis::client</a> to subscribe to some Redis channels as:</p><ul>
<li>the behavior is undefined</li>
<li><a class="el" href="classcpp__redis_1_1client.html">cpp_redis::client</a> is not meant for that </li>
</ul>
</div><h2 class="groupheader">Member Typedef Documentation</h2>
<a id="a19ea39dfabeb19937a9ce4c8d21781b4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a19ea39dfabeb19937a9ce4c8d21781b4">&#9670;&nbsp;</a></span>acknowledgement_callback_t</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef std::function&lt;void(int64_t)&gt; <a class="el" href="classcpp__redis_1_1subscriber.html#a19ea39dfabeb19937a9ce4c8d21781b4">cpp_redis::subscriber::acknowledgement_callback_t</a></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>acknowledgment callback called whenever a subscribe completes takes as parameter the int returned by the redis server (usually the number of channels you are subscribed to) </p>

</div>
</div>
<a id="a2ac29261280f488dab483866ae875656"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a2ac29261280f488dab483866ae875656">&#9670;&nbsp;</a></span>read_callback_t</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef std::function&lt;void(const std::string &amp;, const std::string &amp;)&gt; <a class="el" href="classcpp__redis_1_1subscriber.html#a2ac29261280f488dab483866ae875656">cpp_redis::subscriber::read_callback_t</a></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>subscribe callback, called whenever a new message is published on a subscribed channel takes as parameter the channel and the message </p>

</div>
</div>
<h2 class="groupheader">Member Enumeration Documentation</h2>
<a id="afc976757efd9d0ac4def6935546a2338"></a>
<h2 class="memtitle"><span class="permalink"><a href="#afc976757efd9d0ac4def6935546a2338">&#9670;&nbsp;</a></span>connect_state</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="classcpp__redis_1_1subscriber.html#afc976757efd9d0ac4def6935546a2338">cpp_redis::connect_state</a></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">strong</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>high availability (re)connection states</p><ul>
<li>dropped: connection has dropped</li>
<li>start: attempt of connection has started</li>
<li>sleeping: sleep between two attempts</li>
<li>ok: connected</li>
<li>failed: failed to connect</li>
<li>lookup failed: failed to retrieve master sentinel</li>
<li>stopped: stop to try to reconnect </li>
</ul>

</div>
</div>
<h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a id="a66136601f44564842e2c67de2da199af"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a66136601f44564842e2c67de2da199af">&#9670;&nbsp;</a></span>subscriber()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">cpp_redis::subscriber::subscriber </td>
          <td>(</td>
          <td class="paramtype">const std::shared_ptr&lt; <a class="el" href="classcpp__redis_1_1network_1_1tcp__client__iface.html">network::tcp_client_iface</a> &gt; &amp;&#160;</td>
          <td class="paramname"><em>tcp_client</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">explicit</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>custom ctor to specify custom tcp_client</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">tcp_client</td><td>tcp client to be used for network communications </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="a2faf9e9cc9c95e3c0fed148355af84f1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a2faf9e9cc9c95e3c0fed148355af84f1">&#9670;&nbsp;</a></span>add_sentinel()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void cpp_redis::subscriber::add_sentinel </td>
          <td>(</td>
          <td class="paramtype">const std::string &amp;&#160;</td>
          <td class="paramname"><em>host</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">std::size_t&#160;</td>
          <td class="paramname"><em>port</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">std::uint32_t&#160;</td>
          <td class="paramname"><em>timeout_ms</em> = <code>0</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>add a sentinel definition. Required for <a class="el" href="classcpp__redis_1_1subscriber.html#a6ae8134a9a9b31d6f2434ec4f6e86d3a" title="Connect to redis server. ">connect()</a> or get_master_addr_by_name() when autoconnect is enabled.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">host</td><td>sentinel host </td></tr>
    <tr><td class="paramname">port</td><td>sentinel port </td></tr>
    <tr><td class="paramname">timeout_ms</td><td>maximum time to connect </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a7b4564fc4dfe356b95aeae4fdb8071c9"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7b4564fc4dfe356b95aeae4fdb8071c9">&#9670;&nbsp;</a></span>auth()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classcpp__redis_1_1subscriber.html">subscriber</a>&amp; cpp_redis::subscriber::auth </td>
          <td>(</td>
          <td class="paramtype">const std::string &amp;&#160;</td>
          <td class="paramname"><em>password</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="classcpp__redis_1_1subscriber.html#a5533ac876d3116911b54ff0dce28f61c">reply_callback_t</a> &amp;&#160;</td>
          <td class="paramname"><em>reply_callback</em> = <code>nullptr</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>ability to authenticate on the redis server if necessary this method should not be called repeatedly as the storage of reply_callback is NOT thread safe (only one reply callback is stored for the subscriber client) calling repeatedly <a class="el" href="classcpp__redis_1_1subscriber.html#a7b4564fc4dfe356b95aeae4fdb8071c9" title="ability to authenticate on the redis server if necessary this method should not be called repeatedly ...">auth()</a> is undefined concerning the execution of the associated callbacks </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">password</td><td>password to be used for authentication </td></tr>
    <tr><td class="paramname">reply_callback</td><td>callback to be called on auth completion (nullable) </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>current instance </dd></dl>

</div>
</div>
<a id="a3f8119bc43a67f8e22369aad529444ba"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a3f8119bc43a67f8e22369aad529444ba">&#9670;&nbsp;</a></span>clear_sentinels()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void cpp_redis::subscriber::clear_sentinels </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>clear all existing sentinels. </p>

</div>
</div>
<a id="af78a5542315daac42998809eeec30eef"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af78a5542315daac42998809eeec30eef">&#9670;&nbsp;</a></span>commit()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classcpp__redis_1_1subscriber.html">subscriber</a>&amp; cpp_redis::subscriber::commit </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>commit pipelined transaction that is, send to the network all commands pipelined by calling send() / <a class="el" href="classcpp__redis_1_1subscriber.html#afee579c702182041645a3d3c55de4b9e">subscribe()</a> / ...</p>
<dl class="section return"><dt>Returns</dt><dd>current instance </dd></dl>

</div>
</div>
<a id="a6ae8134a9a9b31d6f2434ec4f6e86d3a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a6ae8134a9a9b31d6f2434ec4f6e86d3a">&#9670;&nbsp;</a></span>connect() <span class="overload">[1/2]</span></h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void cpp_redis::subscriber::connect </td>
          <td>(</td>
          <td class="paramtype">const std::string &amp;&#160;</td>
          <td class="paramname"><em>host</em> = <code>&quot;127.0.0.1&quot;</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">std::size_t&#160;</td>
          <td class="paramname"><em>port</em> = <code>6379</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="classcpp__redis_1_1subscriber.html#a7f9e56873e5b96ad9cb2395dadae1a7a">connect_callback_t</a> &amp;&#160;</td>
          <td class="paramname"><em>connect_callback</em> = <code>nullptr</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">std::uint32_t&#160;</td>
          <td class="paramname"><em>timeout_ms</em> = <code>0</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">std::int32_t&#160;</td>
          <td class="paramname"><em>max_reconnects</em> = <code>0</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">std::uint32_t&#160;</td>
          <td class="paramname"><em>reconnect_interval_ms</em> = <code>0</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Connect to redis server. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">host</td><td>host to be connected to </td></tr>
    <tr><td class="paramname">port</td><td>port to be connected to </td></tr>
    <tr><td class="paramname">connect_callback</td><td>connect handler to be called on connect events (may be null) </td></tr>
    <tr><td class="paramname">timeout_ms</td><td>maximum time to connect </td></tr>
    <tr><td class="paramname">max_reconnects</td><td>maximum attempts of reconnection if connection dropped </td></tr>
    <tr><td class="paramname">reconnect_interval_ms</td><td>time between two attempts of reconnection </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a8fb77a44a1e1f0d99dec639658e2aa7e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a8fb77a44a1e1f0d99dec639658e2aa7e">&#9670;&nbsp;</a></span>connect() <span class="overload">[2/2]</span></h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void cpp_redis::subscriber::connect </td>
          <td>(</td>
          <td class="paramtype">const std::string &amp;&#160;</td>
          <td class="paramname"><em>m_name</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="classcpp__redis_1_1subscriber.html#a7f9e56873e5b96ad9cb2395dadae1a7a">connect_callback_t</a> &amp;&#160;</td>
          <td class="paramname"><em>connect_callback</em> = <code>nullptr</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">std::uint32_t&#160;</td>
          <td class="paramname"><em>timeout_ms</em> = <code>0</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">std::int32_t&#160;</td>
          <td class="paramname"><em>max_reconnects</em> = <code>0</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">std::uint32_t&#160;</td>
          <td class="paramname"><em>reconnect_interval_ms</em> = <code>0</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Connect to redis server. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">m_name</td><td>sentinel m_name </td></tr>
    <tr><td class="paramname">connect_callback</td><td>connect handler to be called on connect events (may be null) </td></tr>
    <tr><td class="paramname">timeout_ms</td><td>maximum time to connect </td></tr>
    <tr><td class="paramname">max_reconnects</td><td>maximum attempts of reconnection if connection dropped </td></tr>
    <tr><td class="paramname">reconnect_interval_ms</td><td>time between two attempts of reconnection </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="aad1d0c3c6edb1522eb7b1bdb64b4705d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aad1d0c3c6edb1522eb7b1bdb64b4705d">&#9670;&nbsp;</a></span>disconnect()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void cpp_redis::subscriber::disconnect </td>
          <td>(</td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>wait_for_removal</em> = <code>false</code></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>disconnect from redis server </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">wait_for_removal</td><td>when set to true, disconnect blocks until the underlying TCP client has been effectively removed from the io_service and that all the underlying callbacks have completed. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a0a6212dfba0513508fdc6377f83a0048"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0a6212dfba0513508fdc6377f83a0048">&#9670;&nbsp;</a></span>get_sentinel() <span class="overload">[1/2]</span></h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const <a class="el" href="classcpp__redis_1_1sentinel.html">sentinel</a>&amp; cpp_redis::subscriber::get_sentinel </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>retrieve sentinel for current client</p>
<dl class="section return"><dt>Returns</dt><dd>sentinel associated to current client </dd></dl>

</div>
</div>
<a id="a4a77354e12a6ef19cad7b0f55b62033c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a4a77354e12a6ef19cad7b0f55b62033c">&#9670;&nbsp;</a></span>get_sentinel() <span class="overload">[2/2]</span></h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classcpp__redis_1_1sentinel.html">sentinel</a>&amp; cpp_redis::subscriber::get_sentinel </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>retrieve sentinel for current client non-const version</p>
<dl class="section return"><dt>Returns</dt><dd>sentinel associated to current client </dd></dl>

</div>
</div>
<a id="af73acfc3c1859e6b32bc9a69856e6e59"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af73acfc3c1859e6b32bc9a69856e6e59">&#9670;&nbsp;</a></span>is_connected()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool cpp_redis::subscriber::is_connected </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>determines client connectivity </p>
<dl class="section return"><dt>Returns</dt><dd>whether we are connected to the redis server </dd></dl>

</div>
</div>
<a id="a8df4503f738566d2acab5f080cd44b53"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a8df4503f738566d2acab5f080cd44b53">&#9670;&nbsp;</a></span>is_reconnecting()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool cpp_redis::subscriber::is_reconnecting </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>determines if reconnect is in progress </p>
<dl class="section return"><dt>Returns</dt><dd>whether an attempt to reconnect is in progress </dd></dl>

</div>
</div>
<a id="a52605edb2a85d370680c3c9e1b84fc3b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a52605edb2a85d370680c3c9e1b84fc3b">&#9670;&nbsp;</a></span>psubscribe()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classcpp__redis_1_1subscriber.html">subscriber</a>&amp; cpp_redis::subscriber::psubscribe </td>
          <td>(</td>
          <td class="paramtype">const std::string &amp;&#160;</td>
          <td class="paramname"><em>pattern</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="classcpp__redis_1_1subscriber.html#a2ac29261280f488dab483866ae875656">read_callback_t</a> &amp;&#160;</td>
          <td class="paramname"><em>callback</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="classcpp__redis_1_1subscriber.html#a19ea39dfabeb19937a9ce4c8d21781b4">acknowledgement_callback_t</a> &amp;&#160;</td>
          <td class="paramname"><em>acknowledgement_callback</em> = <code>nullptr</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>PSubscribes to the given channel and:</p><ul>
<li>calls acknowledgement_callback once the server has acknowledged about the subscription.</li>
<li>calls read_callback each time a message is published on this channel. The command is not effectively sent immediately but stored in an internal buffer until <a class="el" href="classcpp__redis_1_1subscriber.html#af78a5542315daac42998809eeec30eef">commit()</a> is called.</li>
</ul>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">pattern</td><td>pattern to psubscribe </td></tr>
    <tr><td class="paramname">callback</td><td>callback to be called whenever a message is received for this pattern </td></tr>
    <tr><td class="paramname">acknowledgement_callback</td><td>callback to be called on subscription completion (nullable) </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>current instance </dd></dl>

</div>
</div>
<a id="a26edc7dcf87ddc8734fac04878ca307a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a26edc7dcf87ddc8734fac04878ca307a">&#9670;&nbsp;</a></span>punsubscribe()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classcpp__redis_1_1subscriber.html">subscriber</a>&amp; cpp_redis::subscriber::punsubscribe </td>
          <td>(</td>
          <td class="paramtype">const std::string &amp;&#160;</td>
          <td class="paramname"><em>pattern</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>punsubscribe from the given pattern The command is not effectively sent immediately, but stored inside an internal buffer until <a class="el" href="classcpp__redis_1_1subscriber.html#af78a5542315daac42998809eeec30eef">commit()</a> is called.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">pattern</td><td>pattern to punsubscribe from </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>current instance </dd></dl>

</div>
</div>
<a id="afee579c702182041645a3d3c55de4b9e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#afee579c702182041645a3d3c55de4b9e">&#9670;&nbsp;</a></span>subscribe()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classcpp__redis_1_1subscriber.html">subscriber</a>&amp; cpp_redis::subscriber::subscribe </td>
          <td>(</td>
          <td class="paramtype">const std::string &amp;&#160;</td>
          <td class="paramname"><em>channel</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="classcpp__redis_1_1subscriber.html#a2ac29261280f488dab483866ae875656">read_callback_t</a> &amp;&#160;</td>
          <td class="paramname"><em>callback</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="classcpp__redis_1_1subscriber.html#a19ea39dfabeb19937a9ce4c8d21781b4">acknowledgement_callback_t</a> &amp;&#160;</td>
          <td class="paramname"><em>acknowledgement_callback</em> = <code>nullptr</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Subscribes to the given channel and:</p><ul>
<li>calls acknowledgement_callback once the server has acknowledged about the subscription.</li>
<li>calls read_callback each time a message is published on this channel. The command is not effectively sent immediately but stored in an internal buffer until <a class="el" href="classcpp__redis_1_1subscriber.html#af78a5542315daac42998809eeec30eef">commit()</a> is called.</li>
</ul>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">channel</td><td>channel to subscribe </td></tr>
    <tr><td class="paramname">callback</td><td>callback to be called whenever a message is received for this channel </td></tr>
    <tr><td class="paramname">acknowledgement_callback</td><td>callback to be called on subscription completion (nullable) </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>current instance </dd></dl>

</div>
</div>
<a id="a08dffea41cfd5914adfa5a966e0ab292"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a08dffea41cfd5914adfa5a966e0ab292">&#9670;&nbsp;</a></span>unsubscribe()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classcpp__redis_1_1subscriber.html">subscriber</a>&amp; cpp_redis::subscriber::unsubscribe </td>
          <td>(</td>
          <td class="paramtype">const std::string &amp;&#160;</td>
          <td class="paramname"><em>channel</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>unsubscribe from the given channel The command is not effectively sent immediately, but stored inside an internal buffer until <a class="el" href="classcpp__redis_1_1subscriber.html#af78a5542315daac42998809eeec30eef">commit()</a> is called.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">channel</td><td>channel to unsubscribe from </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>current instance </dd></dl>

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>includes/cpp_redis/core/<a class="el" href="subscriber_8hpp_source.html">subscriber.hpp</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.14
</small></address>
</body>
</html>
